/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.taglib;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;

public class ParseFileSize extends TagSupport {
	private static final long serialVersionUID = 1L;
	private long fileSize = 0L;

	public int doStartTag() throws JspException {
		try {
			JspWriter e = this.pageContext.getOut();
			String str = "";
			long size = 0L;
			if (this.fileSize > 1048576L) {
				size = this.fileSize / 1048576L;
				str = size + "M";
			} else {
				size = this.fileSize / 1024L;
				str = size + "K";
			}

			e.print(str);
			return 0;
		} catch (Exception arg4) {
			throw new JspException(arg4.toString());
		}
	}

	public int doEndTag() {
		return 6;
	}

	public long getFileSize() {
		return this.fileSize;
	}

	public void setFileSize(long fileSize) {
		this.fileSize = fileSize;
	}
}